package bairui.international.console.web.controller.authority.authorization.group;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.lianjing.sh.project.authority.web.config.Config_ProjectAuthority_Authority;
import com.lianjing.sh.project.authority.web.controller.authority.tool.Util_Authority;
import com.lianjing.sh.spring.web.controller.base.action.Action;
import com.lianjing.sh.spring.web.controller.enhance.output.FomatOutput;

import bairui.international.service.Service_Group;


/**
 * @generated
 *
 * C_Authority_Authorization_Group_Authority_ModuleRemove
 *
 */
@Controller
public class C_Authority_Authorization_Group_Authority_ModuleRemove
 extends SC_Authority_Authorization_Group_Authority_ModuleRemove 
{
	
	@Autowired private Config_ProjectAuthority_Authority config_Security_Authority;
	@Autowired @Lazy private Service_Group service_Group;

	/**
	 * 移除权限模块
	 */
	@Action(ModuleRemove.class)
	@PutMapping(ModuleRemove.RequestMappingValue)
	public @FomatOutput @ResponseBody Object removeModule(
		ModelMap map, HttpServletRequest request, 
		@PathVariable(name=ModuleRemove.PathVariableName.GroupId) long groupId,
		final String[] groupName_moduleNames
	) throws Exception {
		List<Long> ids = Util_Authority.getActionsId(groupName_moduleNames, config_Security_Authority);
		// 移除
		service_Group.removeAuthorities(groupId, ids);
		return null;
	}
	

}


